package StudyCode.summary.mycollection;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CreatingATypeSpecificListWithGenericList {
	public static void main(String[] args) throws Exception {
		List<Integer> intlist = new ArrayList<Integer>();

		intlist.add(new Integer(123));

		List<Number> numlist = new ArrayList<Number>();

		numlist.add(new Integer(123));
		numlist.add(new Float(123));
		intlist.add(null);
		List<URL> urlList = new ArrayList<URL>();
		try {
			urlList.add(new URL("https://www.tah1986.com"));
		} catch (MalformedURLException e) {
		}
		String s = urlList.get(0).getHost();
		System.out.println(s);
	}
}
